﻿package
{
	
	import flash.events.MouseEvent;
	import flash.display.*;
	import flash.text.*;
	import mcScreenGameOver;
	import Screen
	
	public class ScreenGameOver extends Screen
	{
		
		private var skin:mcScreenGameOverSkin;
		
		public function ScreenGameOver()
		{
			
			super();
			
		}
		
		override public function init():void
		{
			
			destroy();
			skin = new mcScreenGameOverSkin();
			addChild(this.skin);
			skin.playAgainBtn.addEventListener(MouseEvent.CLICK, onSelectionMade);
			skin.quitBtn.addEventListener(MouseEvent.CLICK, onSelectionMade);
			
		}
		
		override public function destroy():void
		{
			
			trace("killing/destroy");
			skin = null;
		
		}
		
		private function onSelectionMade(e:MouseEvent):void
		{
			
			var s:String = e.currentTarget.name;
			
				if (s == "playAgainBtn")
				{
					
					trace("Play again was clicked!");
					
				} else {
					
					trace("Quit was clicked!");
					
				}
		}
	}
}
		